package com;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import static com.IO.*;
public class Main {
    public static void main(String[] args) {
        List<BXEmployee> bxList = readBX();//读入文件中的数据
        List<SPEployee> spList = readSP();
        List<SQED> SQEDList = readEDSQ();
        List<Process> proList = readProcess();
        Scanner scan = new Scanner(System.in);
        System.out.println("欢迎使用财务报销管理系统");
        System.out.println();
        while (true) {
            System.out.println("1.管理员登录");
            System.out.println("2.报销人员登录");
            System.out.println("3.审批人员登录");
            System.out.println("4.报销流程查询");
            System.out.println("5.退出程序");
            System.out.println();
            System.out.print("请输入数字1-5:");
            int login = scan.nextInt();
            if (login > 5 || login < 1) {
                System.out.println("输入有误，请重新输入！");
                continue;
            }
            switch (login) {
                case 1:
                    while (true) {
                        boolean logout = false;//标记用户是否退出到登录界面
                        System.out.println("管理员功能模块\n");
                        System.out.println("1.管理报销人员");
                        System.out.println("2.管理审批人员");
                        System.out.println("3.查询额度授权信息");
                        System.out.println("4.查询报销流程");
                        System.out.println("5.进行打款");
                        System.out.println("6.退出账号，返回登录页面");
                        System.out.println();
                        System.out.print("请输入数字1-6:");
                        int i = scan.nextInt();
                        if (i < 1 || i > 6) {
                            System.out.println("输入错误，请重新输入！");
                            continue;
                        }
                        switch (i) {
                            case 1:
                                boolean flag = false;//标记用户是否返回管理员页面
                                while (true) {
                                    System.out.println("报销人员管理\n");
                                    System.out.println("1.增加报销人员");
                                    System.out.println("2.删除报销人员");
                                    System.out.println("3.修改报销人员");
                                    System.out.println("4.查询报销人员");
                                    System.out.println("5.返回管理员页面\n");
                                    System.out.println("输入(1-5):");
                                    int x = scan.nextInt();
                                    if (x > 5 || x < 0) {
                                        System.out.println("输入错误，请重新输入！");
                                        continue;
                                    }
                                    switch (x) {
                                        case 1:
                                            System.out.print("请输入工号:");
                                            String id = scan.next();
                                            System.out.print("请输入姓名:");
                                            String name = scan.next();
                                            System.out.print("请输入联系电话:");
                                            String phone = scan.next();
                                            bxList.add(new BXEmployee(id, name, phone));//添加信息
                                            writeBX(bxList);//写入
                                            System.out.println("添加报销人员成功！");
                                            break;
                                        case 2:
                                            System.out.print("输入需要删除的报销人员的工号:");
                                            String delBxId = scan.next();
                                            boolean isBxDel = false;//用来做是否删除的标记
                                            for (int k = 0; k < bxList.size(); k++) {
                                                if (bxList.get(k).getId().equals(delBxId)) {
                                                    bxList.remove(bxList.get(k));//如果找到则删除
                                                    writeBX(bxList);
                                                    isBxDel = true;
                                                }
                                            }
                                            if (isBxDel) {
                                                System.out.println("删除报销人员成功！");
                                            } else {
                                                System.out.println("输入的工号有误！");
                                            }
                                            break;
                                        case 3:
                                            System.out.print("输入需要修改的报销人员的工号:");
                                            String BXId = scan.next();
                                            boolean isBx = false;//用来做是否写入的标记
                                            for (BXEmployee bx : bxList) {//遍历
                                                if (bx.getId().equals(BXId)) {//如果存在则修改
                                                    System.out.print("输入修改的姓名:");
                                                    String BXname = scan.next();
                                                    System.out.print("输入修改的手机号:");
                                                    String BXphone = scan.next();
                                                    bx.setName(BXname);
                                                    bx.setPhone(BXphone);
                                                    writeBX(bxList);//写入文件
                                                    isBx = true;
                                                }
                                            }
                                            if (isBx) {
                                                System.out.println("修改报销人员成功！");
                                            } else {
                                                System.out.println("输入的工号有误！");
                                            }
                                            break;
                                        case 4:
                                            System.out.println("报销人员信息\n");
                                            System.out.println("工号\t姓名\t联系电话");
                                            bxList.forEach(System.out::println);//遍历输出
                                            System.out.print("输入任意数字返回报销人员管理页面:");
                                            scan.next();
                                            break;
                                        case 5:
                                            flag = true;
                                            break;
                                    }
                                    if (flag) {
                                        break;
                                    }
                                }
                                break;
                            case 2:
                                boolean flag2 = false;//标记用户是否返回管理员页面
                                while (true) {
                                    System.out.println("审批人员管理\n");
                                    System.out.println("1.增加审批人员");
                                    System.out.println("2.删除审批人员");
                                    System.out.println("3.修改审批人员");
                                    System.out.println("4.查询审批人员");
                                    System.out.println("5.返回管理员页面\n");
                                    System.out.print("请输入数字1-5:");
                                    int m = scan.nextInt();
                                    if (m > 5 || m < 0) {
                                        System.out.println("输入有误，请重新输入！");
                                        continue;
                                    }
                                    switch (m) {
                                        case 1:System.out.print("输入工号:");
                                            String id = scan.next();
                                            System.out.print("输入姓名:");
                                            String name = scan.next();
                                            System.out.print("输入联系电话:");
                                            String phone = scan.next();
                                            System.out.print("输入角色");
                                            String role = scan.next();
                                            spList.add(new SPEployee(id, name, phone, role));//增加到审批人员列表
                                            System.out.println("输入授权额度:");
                                            int money = scan.nextInt();
                                            SQEDList.add(new SQED(role, money, id));//增加到授权额度列表
                                            writeEDSQ(SQEDList);
                                            writeSP(spList);
                                            System.out.println("添加审批人员成功！");
                                            break;
                                        case 2:
                                            System.out.print("请输入需要删除的审批人员的工号:");
                                            String delId = scan.next();
                                            boolean isDel = false;
                                            for (int k = 0; k < spList.size(); k++) {
                                                if (spList.get(k).getId().equals(delId)) {
                                                    spList.remove(spList.get(k));//在审批列表移除要删除的工号
                                                    for (int j = 0; j < SQEDList.size(); j++) {
                                                        if (SQEDList.get(j).getProcess_id().equals(delId)) {
                                                            SQEDList.remove(SQEDList.get(j));//在授权额度列表删除要删除的工号
                                                            writeEDSQ(SQEDList);
                                                        }
                                                    }
                                                    writeSP(spList);
                                                    isDel = true;
                                                }
                                            }
                                            if (isDel) {
                                                System.out.println("删除审批人员成功！");
                                            } else {
                                                System.out.println("输入的工号有误！");
                                            }
                                            break;
                                        case 3:
                                            System.out.print("请输入需修改审批人员的工号:");
                                            String updateId = scan.next();
                                            boolean flag1 = false;
                                            for (SPEployee sp : spList) {
                                                if (sp.getId().equals(updateId)) {
                                                    System.out.print("请输入修改的姓名:");
                                                    String xgname = scan.next();
                                                    System.out.print("请输入修改的手机号:");
                                                    String xgphone = scan.next();
                                                    System.out.println("请输入修改的职位:");
                                                    String xgrole = scan.next();
                                                    sp.setName(xgname);
                                                    sp.setPhone(xgphone);
                                                    sp.setRole(xgrole);
                                                    for (SQED sqed : SQEDList) {//遍历列表来修改
                                                        if (sqed.getProcess_id().equals(updateId)) {
                                                            sqed.setRole(xgrole);
                                                        }
                                                    }
                                                    writeEDSQ(SQEDList);
                                                    writeSP(spList);
                                                    flag1 = true;
                                                }
                                            }
                                            if (flag1) {
                                                System.out.println("修改报销人员信息成功！");
                                            } else {
                                                System.out.println("输入的工号有误！");
                                            }
                                            break;
                                        case 4:
                                            System.out.println("审批人员信息");
                                            System.out.println();
                                            System.out.println("工号\t姓名\t联系电话\t角色");
                                            spList.forEach(System.out::println);//遍历输出
                                            System.out.print("请输入任意字符返回审批人员管理页面:");
                                            scan.next();
                                            break;

                                        case 5:
                                            flag2 = true;
                                            break;
                                    }
                                    if (flag2) {
                                        break;
                                    }
                                }
                                break;
                            case 3:
                                System.out.println("额度授权信息\n");
                                System.out.println("序号\t角色\t额度\t审批人");
                                for (int j = 0; j < SQEDList.size(); j++) {
                                    System.out.println((j + 1) + "" + SQEDList.get(j));
                                }
                                System.out.print("请输入任意字符返回管理员界面:");
                                scan.nextInt();
                                break;
                            case 4:
                                System.out.println("报销流程记录\n");
                                System.out.println("报销单编号\t提单人\t提单金额\t提单日期\t状态\t处理人");
                                proList.forEach(System.out::println);//遍历输出
                                System.out.print("请输入任意字符返回管理员界面:");
                                scan.next();
                                break;
                            case 5:
                                ArrayList<Process> newList = new ArrayList<>();//用于存储当前显示的订单流程
                                for (Process process : proList) {
                                    if (process.getStatus().equals("财务审批")) {
                                        newList.add(process);
                                    }
                                }
                                if (newList.isEmpty()) {
                                    System.out.println("当前没有需要付款的报销单！");
                                } else {
                                    System.out.println("报销单编号\t提单人\t提单日期\t状态\t处理人");
                                    newList.forEach(System.out::println);
                                    System.out.println("请输入需要付款的单号");
                                    String S=scan.next();
                                    boolean isExist2 = false;//用于标记是否找到该订单
                                    for (Process value : newList) {
                                        if(value.getId().equals(S)){
                                            isExist2=true;
                                            value.setProcess_id("");
                                            value.setStatus("付款结束");
                                            System.out.println("打款成功！");

                                            writeProcess(proList);}
                                    }
                                    if(!isExist2){
                                        System.out.println("没有此单！");
                                    }
                                }break;
                            case 6:
                                logout = true;
                                break;
                        }
                        if (logout) {
                            break;
                        }
                    }
                    break;
                case 2:
                    System.out.print("输入报销人员姓名：");
                    String bxname = scan.next();
                    Iterator<BXEmployee> iterator = bxList.iterator();
                    BXEmployee BX = null;
                    boolean isExist = false;
                    while (iterator.hasNext()) {//遍历报销人员列表
                        BXEmployee bx = iterator.next();
                        if (bx.getName().equals(bxname)) {//找到报销人员
                            isExist = true;
                            BX = bx;
                        }
                    }
                    if (isExist) {
                        boolean flag = false;//标记用户是否退出登录
                        while (true) {
                            System.out.println("报销人员功能模块\n");
                            System.out.println("1.创建报销单");
                            System.out.println("2.查询报销人员");
                            System.out.println("3.查询审批人员");
                            System.out.println("4.查询额度授权");
                            System.out.println("5.查询报销流程");
                            System.out.println("6.退出账号，返回登录页面\n");
                            System.out.print("请输入数字1-6:");
                            int cnt = scan.nextInt();
                            if (cnt< 0 || cnt > 6) {
                                System.out.println("输入错误，请重新输入！");
                                continue;
                            }
                            switch (cnt) {
                                case 1:
                                    System.out.println("提交报销申请信息\n");
                                    System.out.print("输入申请金额:");
                                    int money = scan.nextInt();
                                    System.out.print("输入申请日期(yyyyMMdd):");
                                    String date = scan.next();
                                    Process process = new Process();
                                    int random = (int) (Math.random() * 1000 + 1000);
                                    process.setId("2022" + random);//订单id随机生成
                                    process.setBxEp_id(BX.getId());
                                    process.setMoney(money);
                                    process.setDate(date);
                                    process.setStatus("创建");
                                    process.setProcess_id(BX.getId());
                                    proList.add(process);
                                    writeProcess(proList);//将添加过的数据保存到txt中
                                    break;
                                case 2:
                                    System.out.println("报销人员信息");
                                    System.out.println();
                                    System.out.println("工号\t姓名\t联系电话");
                                    bxList.forEach(System.out::println);//遍历输出报销人员信息
                                    System.out.print("请输入任意字符返回报销人员页面:");
                                    scan.next();
                                    break;
                                case 3:
                                    System.out.println("审批人员信息");
                                    System.out.println();
                                    System.out.println("工号\t姓名\t联系电话\t角色");
                                    spList.forEach(System.out::println);//遍历输出审批人员信息
                                    System.out.print("请输入任意字符返回报销人员页面:");
                                    scan.next();
                                    break;
                                case 4:
                                    System.out.println("额度授权信息");
                                    System.out.println();
                                    System.out.println("序号\t角色\t额度\t审批人");
                                    for (int j = 0; j < SQEDList.size(); j++) {
                                        System.out.println((j + 1) + "" + SQEDList.get(j));//遍历输出额度授权信息
                                    }
                                    System.out.print("请输入任意字符返回报销人员页面:");
                                    scan.next();
                                    break;
                                case 5:
                                    System.out.println("报销流程");
                                    System.out.println();
                                    System.out.println("报销单编号\t提单人\t提单金额\t提单日期\t状态\t处理人");
                                    proList.forEach(System.out::println);//遍历输出报销流程
                                    System.out.print("请输入任意数字返回报销人员页面:");
                                    scan.next();
                                    break;
                                case 6:
                                    flag = true;
                                    break;
                            }
                            if (flag) {
                                break;
                            }
                        }
                    } else {
                        System.out.println("报销人员姓名不存在，请重新输入！");
                        continue;
                    }
                    break;
                case 3:
                    System.out.print("请输入审批人员姓名：");
                    String spname = scan.next();
                    boolean isExist1 = false;
                    SPEployee spEployee=null;
                    for (SPEployee eployee : spList) {
                        if (eployee.getName().equals(spname)) {
                            isExist1 = true;
                            spEployee = eployee;//找到则赋值给临时对象
                        }
                    }
                    if (isExist1) {
                        boolean flag = false;//标记用户是否退出登录
                        while (true) {
                            System.out.println("审批人员功能模块");
                            System.out.println();
                            System.out.println("1.审批报销单");
                            System.out.println("2.查询报销人员");
                            System.out.println("3.查询审批人员");
                            System.out.println("4.查询额度授权");
                            System.out.println("5.查询审批流程");
                            System.out.println("6.退出账号，返回登录页面");
                            System.out.println();
                            System.out.print("请输入数字1-6:");
                            int ii = scan.nextInt();
                            if (ii < 0 || ii > 6) {
                                System.out.println("输入有误，请重新输入！");
                                continue;
                            }
                            switch (ii) {
                                case 1:
                                    switch (spEployee.getRole()) {
                                        case "部门副主管": {
                                            ArrayList<Process> newList = new ArrayList<>();//用于存储当前显示的订单流程
                                            System.out.print("当前可审批的报销单记录");
                                            System.out.println();
                                            System.out.println("报销单编号\t提单人\t提单金额\t提单日期\t状态\t处理人");
                                            for (Process process : proList) {

                                                if (process.getStatus().equals("创建") && process.getMoney() <=50000) {
                                                    newList.add(process);
                                                }
                                            }
                                            if (newList.isEmpty()) {
                                                System.out.println("当前没有需要审批的单子！");
                                            } else {
                                                newList.forEach(System.out::println);
                                                System.out.println();
                                                System.out.print("输入需要审批的订单号:");
                                                String orderId = scan.next();
                                                boolean isExist2 = false;//用于标记是否找到该订单
                                                for (Process value : newList) {
                                                    if (value.getId().equals(orderId)) {
                                                        isExist2 = true;
                                                        System.out.println("1.审批");
                                                        System.out.println("2.驳回");
                                                        System.out.println();
                                                        System.out.print("请输入数字1-2:");
                                                        int m = scan.nextInt();
                                                        if (m < 0 || m > 2) {
                                                            System.out.println("输入有误！");
                                                            continue;
                                                        }
                                                        switch (m) {
                                                            case 1:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("部门审批");
                                                                System.out.println("审批成功！");
                                                                writeProcess(proList);//写入流程
                                                                break;
                                                            case 2:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("部门驳回");
                                                                System.out.println("驳回成功！");
                                                                writeProcess(proList);//写入流程
                                                                break;
                                                        }
                                                    }
                                                }
                                                if(!isExist2){
                                                    System.out.println("没有此单！");
                                                }
                                            }

                                            break;
                                        }
                                        case "部门主管": {
                                            ArrayList<Process> newList = new ArrayList<>();//用于存储当前显示的订单流程
                                            System.out.print("当前可审批的报销单记录");
                                            System.out.println();
                                            System.out.println("报销单编号\t提单人\t报销金额\t提单日期\t状态\t处理人");
                                            for (Process process : proList) {
                                                if (process.getStatus().equals("创建") && process.getMoney() > 50000 && process.getMoney() <= 100000) {
                                                    newList.add(process);//添加到临时变量
                                                }
                                            }
                                            if (newList.isEmpty()) {
                                                System.out.println("当前没有需要审批报销流程！");
                                            } else {
                                                newList.forEach(System.out::println);
                                                System.out.println();
                                                System.out.print("输入需要审批的订单号:");
                                                String orderId = scan.next();
                                                boolean isExist2 = false;//用于标记是否找到该订单
                                                for (Process value : newList) {
                                                    if (value.getId().equals(orderId)) {
                                                        isExist2 = true;
                                                        System.out.println("1.审批");
                                                        System.out.println("2.驳回");
                                                        System.out.println();
                                                        System.out.print("输入(1-2):");
                                                        int iii = scan.nextInt();
                                                        if (iii < 0 || iii > 2) {
                                                            System.out.println("输入有误！");
                                                            continue;
                                                        }
                                                        switch (iii) {
                                                            case 1:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("部门审批");
                                                                System.out.println("审批成功！");
                                                                writeProcess(proList);
                                                                break;
                                                            case 2:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("部门驳回");
                                                                System.out.println("驳回成功！");
                                                                writeProcess(proList);
                                                                break;
                                                        }
                                                    }
                                                }
                                                if(!isExist2) System.out.println("没有此单！");
                                            }
                                            break;
                                        }
                                        case "财务副主管": {
                                            ArrayList<Process> newList = new ArrayList<>();//用于存储当前显示的订单流程

                                            System.out.print("当前可审批的报销单记录");
                                            System.out.println();
                                            System.out.println("报销单编号\t提单人\t报销金额\t提单日期\t状态\t处理人");
                                            for (Process process : proList) {
                                                if (process.getStatus().equals("部门审批") && process.getMoney() <= 50000) {
                                                    newList.add(process);//添加到临时对象
                                                }
                                            }
                                            if (newList.isEmpty()) {
                                                System.out.println("当前没有需要审批报销流程！");
                                            } else {
                                                newList.forEach(System.out::println);
                                                System.out.println();
                                                System.out.print("输入需要审批的订单号:");
                                                String orderId = scan.next();
                                                boolean isExist2 = false;//用于标记是否找到该订单
                                                for (Process value : newList) {
                                                    if (value.getId().equals(orderId)) {
                                                        isExist2 = true;
                                                        System.out.println("1.审批");
                                                        System.out.println("2.驳回");
                                                        System.out.println();
                                                        System.out.print("输入(1-2):");
                                                        int iii = scan.nextInt();
                                                        if (iii < 0 || iii > 2) {
                                                            System.out.println("输入有误！");
                                                            continue;
                                                        }
                                                        switch (iii) {
                                                            case 1:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("财务审批");
                                                                System.out.println("审批成功！");
                                                                writeProcess(proList);
                                                                break;
                                                            case 2:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("财务驳回");
                                                                System.out.println("驳回成功！");
                                                                writeProcess(proList);
                                                                break;
                                                        }
                                                    }
                                                }
                                                if(!isExist2){
                                                    System.out.println("没有此单！");

                                                }
                                            }
                                            break;
                                        }
                                        case "财务主管": {
                                            ArrayList<Process> newList = new ArrayList<>();//用于存储当前显示的订单流程

                                            System.out.print("当前可审批的报销单记录");
                                            System.out.println();
                                            System.out.println("报销单编号\t提单人\t提单日期\t状态\t处理人");
                                            for (Process process : proList) {
                                                if (process.getStatus().equals("部门审批") && process.getMoney() > 50000 && process.getMoney() <= 100000) {
                                                    newList.add(process);//添加到临时变量
                                                                                              }
                                            }
                                            if (newList.isEmpty()) {
                                                System.out.println("当前没有需要审批的报销流程！");
                                            } else {
                                                newList.forEach(System.out::println);
                                                System.out.println();
                                                System.out.print("输入需要审批的订单号:");
                                                String orderId = scan.next();
                                                boolean isExist2 = false;//用于标记是否找到该订单
                                                for (Process value : newList) {
                                                    isExist2 = true;
                                                    if (value.getId().equals(orderId)) {
                                                        System.out.println("1.审批");
                                                        System.out.println("2.驳回");
                                                        System.out.println();
                                                        System.out.print("输入(1-2):");
                                                        int iii = scan.nextInt();
                                                        if (iii < 0 || iii > 2) {
                                                            System.out.println("输入有误！");
                                                            continue;
                                                        }
                                                        switch (iii) {
                                                            case 1:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("财务审批");
                                                                System.out.println("审批成功！");
                                                                writeProcess(proList);
                                                                break;
                                                            case 2:
                                                                value.setProcess_id(spEployee.getId());
                                                                value.setStatus("财务驳回");
                                                                System.out.println("驳回成功！");
                                                                writeProcess(proList);
                                                                break;
                                                        }
                                                    }
                                                }
                                                if(!isExist2){
                                                    System.out.println("没有此单！");
                                                }
                                            }
                                            break;
                                        }
                                    }
                                    System.out.println("请输入任意字符返回审批人员页面:");
                                    scan.next();
                                    break;
                                case 2:
                                    System.out.println("报销人员信息");
                                    System.out.println();
                                    System.out.println("工号\t姓名\t联系电话");
                                    bxList.forEach(System.out::println);//遍历输出信息
                                    System.out.print("请输入任意字符返回审批人员页面:");
                                    scan.next();
                                    break;
                                case 3:
                                    System.out.println("审批人员信息");
                                    System.out.println();
                                    System.out.println("工号\t姓名\t联系电话\t角色");
                                    spList.forEach(System.out::println);//遍历输出信息
                                    System.out.print("请输入任意数字返回审批人员页面:");
                                    scan.next();
                                    break;
                                case 4:
                                    System.out.println("额度授权信息");
                                    System.out.println();
                                    System.out.println("序号\t角色\t额度\t审批人");
                                    for (int j = 0; j < SQEDList.size(); j++) {
                                        System.out.println((j + 1) + "" + SQEDList.get(j));
                                    }
                                    System.out.print("请输入任意数字返回审批人员页面:");
                                    scan.nextInt();
                                    break;
                                case 5:
                                    System.out.println("报销审批流程记录");
                                    System.out.println();
                                    System.out.println("报销单编号\t提单人\t提单金额\t提单日期\t状态\t处理人");
                                    proList.forEach(System.out::println);//遍历输出信息
                                    System.out.print("请输入任意数字返回审批人员页面:");
                                    scan.next();
                                    break;
                                case 6:
                                    flag = true;
                                    break;
                            }
                            if (flag) {
                                break;
                            }
                        }
                    } else {
                        System.out.println("审批人员姓名不存在，请重新输入！");
                        continue;
                    }
                    break;
                case 4:
                    System.out.println("1.输入报销单编号");
                    System.out.println("2.输入提单人id");
                    System.out.println("请输入数字1-2：");
                    int num;
                    num=scan.nextInt();
                    while(num!=1&&num!=2){
                        System.out.println("输入错误请重新输入！");
                        num=scan.nextInt();
                    }
                    switch (num){
                        case 1:
                            System.out.println("请输入报销单编号");
                            String s =scan.next();
                            Iterator<Process> iterator2 = proList.iterator();
                            System.out.println(proList);
                            boolean isExist4 = false;//判断是否存在该编号
                            while (iterator2.hasNext()) {
                                Process pr = iterator2.next();//创建一个对象来遍历
                                if (pr.getId().equals(s)) {//找到则赋给临时对象
                                    isExist4=true;
                                    System.out.println(pr.getId()+'\t'+pr.getBxEp_id()+'\t'+pr.getMoney()+'\t'+pr.getDate()+'\t'+pr.getStatus()+'\t'+pr.getProcess_id()+'\n');
                                }
                            }
                            if(!isExist4){
                                System.out.println("没找到该编号!");
                            }break;
                        case 2:
                            System.out.println("请输入提单人id:");
                            String bxs =scan.next();
                            Iterator<Process> iterator3 = proList.iterator();
                            boolean isExist5 = false;//判断是否存在此id
                            while (iterator3.hasNext()) {
                                Process pr2 = iterator3.next();//创建一个对象来遍历
                                if (pr2.getBxEp_id().equals(bxs)) {//找到则赋给临时对象
                                    isExist5=true;
                                    System.out.println(pr2.getId()+'\t'+pr2.getBxEp_id()+'\t'+pr2.getMoney()+'\t'+pr2.getDate()+'\t'+pr2.getStatus()+'\t'+pr2.getProcess_id());
                                }
                            }
                            if(!isExist5){
                                System.out.println("没找到此id!");
                            }break;
                    }break;
                case 5:
                    System.out.println("程序退出中......");
                    System.exit(0);
            }
        }
    }
}